import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexMatches {
    public static void main(String[] args) {
        // 按指定模式在字符串查找
        String line = "This order was placed for QT3000! OK?";
        String pattern = "(\\D*)(\\d+)(.*)";
        //    D* 非数字匹配，所有的
        Pattern pattern1 = Pattern.compile(pattern);
        Matcher matcher = pattern1.matcher(line);
        //public boolean find()
        //尝试查找与该模式匹配的输入序列的下一个子序列。
        if (matcher.find()) {
            System.out.println("1 Found value: " + matcher.group(0));
            System.out.println("2 Found value: " + matcher.group(1));
            System.out.println("3 Found value: " + matcher.group(2));
            System.out.println("4 Found value: " + matcher.group(3));
        } else {

            System.out.println("NO MATCH");

        }
    }
}
